﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeTop.八股
{
   class MyBaseClass
    {

        public string name = "父亲";
        public virtual void PrintMyname() {


            Console.WriteLine(name);
        }
    }


    class MyClass:MyBaseClass
    {
        public new string age = "override儿子18岁";
        public override void PrintMyname()
        {


          // base.PrintMyname();
            Console.WriteLine(age);
        }
    }
    class MyClass1 : MyBaseClass
    {
        public new string name = "override儿子";
        public new void PrintMyname()
        {


            Console.WriteLine(name);
        }
    }

    class ProgramBase
    {


        static void MainBase(string[] args)
        {
            
            MyClass myClass = new MyClass();
            myClass.PrintMyname();
            MyClass1 myClass1 = new MyClass1();
            myClass1.PrintMyname();
        }
    }
}
